// Files utils.


#ifndef LIGHTY_FILES_H 
#define LIGHTY_FILES_H

#include <fstream>
#include "Lighty_Debug.h"

int Lighty_CheckFiles(const char* file){

  std::ifstream check(file);
  
  if(check){
  
    return 0;
  
  }
  
  else{
  
    Lighty_PrintDebug("File error : File not found, cant check other files !");
    return 1;
  
  }

}

unsigned long Lighty_Get_FileLength(const char* filepath){

  std::ifstream file;
  file.open(filepath, std::ios::in);
  
  if(file.good()){
  
    file.seekg(0,std::ios::end);
    unsigned long len=file.tellg();
    file.seekg(std::ios::beg);
    return len;
  
  }
  
  else{
  
    Lighty_PrintDebug("File error : File not found, cant check lenght !");
    return 1;
  
  }

}

#endif
